package com.File;

import java.io.*;

public class BufferedReader01 {
    public static void main(String[] args) throws IOException {
        String filePath = "D:\\IDEA\\src\\jdbc.java";
        //创建BufferedReader
        BufferedReader bufferedReader = new BufferedReader(new FileReader(filePath));
        String line;
//        line = bufferedReader.readLine();//按行读取文件,
        while ((line = bufferedReader.readLine())!=null){
            System.out.println(line);
        }
        //关闭流,只需要关闭BufferedReader,因为底层会自动关闭节点流
        bufferedReader.close();
    }
}
